package com.ruoyi.edit.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.edit.utils.UuidUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.edit.mapper.DevelopReviewMapper;
import com.ruoyi.edit.domain.DevelopReview;
import com.ruoyi.edit.service.IDevelopReviewService;
import com.ruoyi.common.core.text.Convert;

/**
 * 核检月Service业务层处理
 * 
 * @author qiufeng
 * @date 2022-05-10
 */
@Service
public class DevelopReviewServiceImpl implements IDevelopReviewService 
{
    @Autowired
    private DevelopReviewMapper developReviewMapper;

    /**
     * 查询核检月
     * 
     * @param id 核检月主键
     * @return 核检月
     */
    @Override
    public DevelopReview selectDevelopReviewById(String id)
    {
        return developReviewMapper.selectDevelopReviewById(id);
    }

    /**
     * 查询核检月列表
     * 
     * @param developReview 核检月
     * @return 核检月
     */
    @Override
    public List<DevelopReview> selectDevelopReviewList(DevelopReview developReview)
    {
        return developReviewMapper.selectDevelopReviewList(developReview);
    }

    /**
     * 新增核检月
     * 
     * @param developReview 核检月
     * @return 结果
     */
    @Override
    public int insertDevelopReview(DevelopReview developReview)
    {
        developReview.setId(UuidUtil.getUuid());
        developReview.setDeleted(0);
        developReview.setCreated(new Date());
        developReview.setCreateBy(ShiroUtils.getLoginName());
        developReview.setCreatedName(ShiroUtils.getName());
        return developReviewMapper.insertDevelopReview(developReview);
    }

    /**
     * 修改核检月
     * 
     * @param developReview 核检月
     * @return 结果
     */
    @Override
    public int updateDevelopReview(DevelopReview developReview)
    {
        developReview.setCreateBy(ShiroUtils.getLoginName());
        developReview.setCreatedName(ShiroUtils.getName());
        return developReviewMapper.updateDevelopReview(developReview);
    }

    /**
     * 批量删除核检月
     * 
     * @param ids 需要删除的核检月主键
     * @return 结果
     */
    @Override
    public int deleteDevelopReviewByIds(String ids)
    {
        return developReviewMapper.deleteDevelopReviewByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除核检月信息
     * 
     * @param id 核检月主键
     * @return 结果
     */
    @Override
    public int deleteDevelopReviewById(String id)
    {
        return developReviewMapper.deleteDevelopReviewById(id);
    }
}
